package org.dxy.domain.event.workorder;

import org.dxy.domain.event.AggregateTypeEnum;
import org.dxy.domain.event.DomainEvent;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 工单计划时间变更事件
 * 
 * @author dxy
 * @createTime 2025/12/01 15:00
 */
public record WorkOrderPlannedTimeChangedEvent(
    /** 工单ID */
    Long workOrderId,
    /** 工单编码 */
    String workOrderCode,
    /** 新的计划开始时间 */
    LocalDate plannedStartTime,
    /** 新的计划结束时间 */
    LocalDate  plannedEndTime
) implements DomainEvent {
    
    @Override
    public Long aggregateId() {
        return workOrderId;
    }

    @Override
    public String aggregateType() {
        return AggregateTypeEnum.WORK_ORDER.getKey();
    }

    @Override
    public String eventType() {
        return "WORK_ORDER_PLANNED_TIME_CHANGED";
    }
}